﻿Class Interrupt_AP_TC_MVD_TC001
    Inherits seTelnet
    Sub New(ByVal ip As String)
        MyBase.New(ip)
    End Sub
    Public Overrides Function runStep(ByVal loginStep As Integer, ByVal sectionStr As String) As RunStepMsg
        Select Case loginStep
            Case 0
                If (sectionStr.EndsWith("login: ")) Then
                    MyBase.SocketSend("admin" & vbCrLf)

                    Return RunStepMsg.nextStep
                End If
            Case 1
                If (sectionStr.EndsWith("Password: ")) Then
                    MyBase.SocketSend("admin" & vbCrLf)

                    Return RunStepMsg.nextStep
                End If
            Case 2
                If (sectionStr.EndsWith("\> ")) Then
                    MyBase.SocketSend("ps -a ap_tc_mvd.exe" & vbCrLf)

                    Return RunStepMsg.nextStep
                End If

            Case 3
                ' If (sectionStr.Contains("Killed") Or sectionStr.EndsWith("\> ")) Then
                'If (sectionStr.Contains("Killed")) Then
                '    Return RunStepMsg.RunEnd
                'Else
                '    'Return RunStepMsg.Fail
                'End If
                If (sectionStr.Contains("can't kill")) Then
                    Return RunStepMsg.Fail
                Else
                    Return RunStepMsg.RunEnd
                End If
            Case Else

        End Select
        Return RunStepMsg.wait
    End Function
End Class